home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / alib / csup / math_support / RAM / bcint.asm next >
Encoding:
Assembly Source File  |  1994-02-14  |  3.0 KB  |  118 lines

  1.  
  2.  
  3. *          ************************************************ 
  4. *          **  Math Library C Compiler Interface         ** 
  5. *          **                                            ** 
  6. *          ************************************************ 
  7. ***********************************************************************
  8. **                                                                    *
  9. **   Copyright 1984, Amiga Computer Inc.   All rights reserved.       *
  10. **   No part of this program may be reproduced, transmitted,          *
  11. **   transcribed, stored in retrieval system, or translated into      *
  12. **   any language or computer language, in any form or by any         *
  13. **   means, electronic, mechanical, magnetic, optical, chemical,      *
  14. **   manual or otherwise, without the prior written permission of     *
  15. **   Amiga Computer Incorporated, 3350 Scott Blvd, Bld #7,            *
  16. **   Santa Clara, CA 95051                                            *
  17. **                                                                    *
  18. ***********************************************************************
  19.  
  20. * 3-26-86  Dale converted to use new greenhills compiler, cleaned up abit
  21. * 11:50 04-Jun-85 LAH Broke up math library to create ROM, RAM and Link.
  22. * 15:50 14-Apr-85 KBS Converted to V25 standard compatible library.
  23. * 09:35 28-Jan-85 MJS moved float/string conversion to V2xstr.asm
  24. * 14:41  1-Jan-85 MJS added float/string conversion
  25. * 16:00 12-Dec-84 MJS first version
  26. * 10:56 30-Dec-84 MJS version for RAM or ROM math library
  27.  
  28.         xref     _MathBase
  29.  
  30. *------ Basic Math Function Vector Offsets --------------------------
  31.  
  32.         xref    _LVOSPFix,_LVOSPFlt,_LVOSPCmp,_LVOSPTst,_LVOSPAbs
  33.         xref    _LVOSPNeg,_LVOSPAdd,_LVOSPSub,_LVOSPMul,_LVOSPDiv
  34.  
  35.         xdef    ffixi,fflti,ffltis                * C entries for basic math functions
  36.         xdef    fcmpi,fabsi,fnegi
  37.         xdef    faddi,fsubi,fmuli,fdivi
  38.         xdef    _abs
  39.  
  40. * new ones from Dale
  41. * added 3/26/86
  42. * these have parameters already in registers d0,d1
  43. * these are routines just for single precision FLOAT
  44.         xdef    fsfixi,fsdivi,fsaddi,fsmuli,fststi,fssubi
  45.         xdef    fsnegi,fscmpi
  46.  
  47. shit_do:
  48.         add.l    _MathBase,a0
  49.         move.l    4(sp),d1        * get second parameter
  50.         move.l    (sp),8(sp)        * setup return address
  51.         addq.l    #8,sp            * non-standard c-interface
  52.         jmp    (a0)
  53.  
  54. * hack stuff here
  55. fmuli:
  56.         lea    _LVOSPMul,a0
  57.         bra    shit_do
  58. faddi:
  59.         lea    _LVOSPAdd,a0
  60.         bra    shit_do
  61. fsubi:
  62.         lea    _LVOSPSub,a0
  63.         bra    shit_do
  64. fdivi:
  65.         lea    _LVOSPDiv,a0
  66.         bra    shit_do
  67. fcmpi:
  68.         lea    _LVOSPCmp,a0
  69.         bra    shit_do
  70.  
  71. fsmuli:
  72.         move.l    _MathBase,a0
  73.         jmp    _LVOSPMul(a0)
  74.  
  75. fsaddi:
  76.         move.l    _MathBase,a0
  77.         jmp    _LVOSPAdd(a0)
  78.  
  79. fssubi:
  80.         move.l    _MathBase,a0
  81.         jmp    _LVOSPSub(a0)
  82.  
  83. fsdivi:
  84.         move.l    _MathBase,a0
  85.         jmp    _LVOSPDiv(a0)
  86.  
  87. ffixi:
  88. fsfixi:
  89.         move.l    _MathBase,a0
  90.         jmp    _LVOSPFix(a0)
  91.  
  92. fflti:
  93. ffltis:
  94.         move.l    _MathBase,a0
  95.         jmp    _LVOSPFlt(a0)
  96.  
  97. fststi:
  98.         move.l    _MathBase,a0
  99.         jmp    _LVOSPTst(a0)
  100.  
  101. _abs:
  102.         move.l    4(sp),d0
  103. fabsi:
  104.         move.l    _MathBase,a0
  105.         jmp    _LVOSPAbs(a0)
  106.  
  107. fnegi:
  108. fsnegi:
  109.         move.l    _MathBase,a0
  110.         jmp    _LVOSPNeg(a0)
  111.  
  112. fscmpi:
  113.         move.l    _MathBase,a0
  114.         jmp    _LVOSPCmp(a0)
  115.  
  116.         end
  117.  
  118.